﻿<?php $this->beginContent('/layouts/main');?>

        <!-- Main Content -->
        <div id="main">
        	<hr class="clearfix" />
        	    <?php if(isset($this->breadcrumbs)):?>
					<?php $this->widget('ext.jbreadcrumbs.jbreadcrumbsWidget',array(
							'links'=>$this->breadcrumbs
					));?>
				<?php endif;?>
				<hr class="clearfix" />
			<?php echo $content;?>		
		</div>
		        <!-- Sidebar -->
        <div id="sidebar">

            <input type="text" value="Search" default-value="Search" class="search" />
            <?php if (!Yii::app()->user->isGuest):?>
				<?php $this->widget('application.components.panels.QuickPanel',array(
							'route'=>$this->id
						));?>
			<?php else:?>
			<div class="widget">
				<h5>鐢ㄦ埛鐧诲綍</h5>
				
				<?php $this->widget('ext.login.loginWidget',array(
							'view'=>'theme/light/login'
						));?>				
			</div>

			<?php endif;?>
            <!-- Blog Categories -->
            <div class="widget" id="categories">
                <h5>鍗氬鍒嗙被</h5>					
				<?php		
					echo UtilTree::generateTree(Category::model()->getMenuByType(Category::CATEGORY_NEWS),0,'/blog/list',array('class'=>'categories'));
				?>
            </div>
            <!-- /Blog Categories -->

            <!-- Text Widget -->
            <div class="widget">
                <h5>甯哥敤鏍囩</h5>
                <p><?php echo Tag::model()->generateTagsCloud(Category::CATEGORY_NEWS,30,'/blog/tags');?></p>
            </div>
            <!-- /Text Widget -->
            
            <div class="widget">
            	<h5>鏃ュ巻</h5>
            	<?php
            	
            		//$this->widget('ext.calendar.CalendarWidget');
            	
					$month = date('m');
					$year = date('Y');
				
					$calendar = new Calendar();
					echo $calendar->init($month, $year,array(2,11,14,22,26));
            	
            	?>
            </div>

            <!-- Tabs Widget With Posts -->
            <div class="widget">
                <h5>鏃ュ織</h5>
                <ul id="tabs">
                    <li class="active"><a href="#tab1">鏈€杩戝彂甯?/a></li>
                    <li><a href="#tab2">鐑棬鏃ュ織</a></li>
                </ul>
                <div id="tabs_content_container">
                    <div id="tab1" class="tab-content">
                        <?php $this->widget('application.components.blog.BlogLatest',array(
                        			'htmlOptions'=>array(
                        					'class'=>'posts',
											'length'=>40		

									)
                        		));?>
                    </div>
                    <div id="tab2" class="tab-content">
                        <?php $this->widget('application.components.blog.BlogHot',array(
                        			'htmlOptions'=>array(
                        					'class'=>'posts',
											'length'=>40		

									)
                        		));?>
                    </div>
                </div>
            </div>
            <!-- /Tabs Widget With Posts -->

            <!-- Twitter Feed -->
            <div class="widget">
                <h5>Latest Tweets</h5>
                <div class="twitter-feed">
                    <p>
                        12 Outstanding Videos That Make Good Creative Use of AudioJungle Tracks <a href="./blog.html">http://t.co/7USabnpS</a>
                        <span class="tweet-time">7 hours ago</span>
                    </p>
                    <p>
                        Farewell Envato 鈥?I Will Miss You! <a href="./blog.html">http://t.co/ommJTJgp</a>
                        <span class="tweet-time">Sep 5 (1 day ago)</span>
                    </p>
                </div>
            </div>
            <!-- /Twitter Feed -->

            <!-- Photo Stream -->
            <div class="widget">
                <h5>Flickr Feed</h5>
                <ul class="photo-stream">

                </ul>
            </div>
            <!-- /Photo Stream -->

        </div>
        <!-- /Sidebar -->
<?php $this->endContent();?>
